package com.zoo.diannaopeijian.service.impl;

import com.zoo.diannaopeijian.domain.SupplyChannel;
import com.zoo.diannaopeijian.domain.SupplyChannelExample;
import com.zoo.diannaopeijian.mapper.SupplyChannelMapper;
import com.zoo.diannaopeijian.service.SupplyChannelService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by zx583 on 2018-01-21.
 */
@Service
public class SupplyChannelServiceImpl implements SupplyChannelService {
    @Resource
    private SupplyChannelMapper supplyChannelMapper;

    @Override
    public boolean addSupplyChannel(SupplyChannel supplyChannel) {
        return supplyChannelMapper.insertSelective(supplyChannel) == 1;
    }

    @Override
    public boolean deleteSupplyChannel(Integer supplychannelid) {
        return supplyChannelMapper.deleteByPrimaryKey(supplychannelid) == 1;
    }

    @Override
    public boolean updateSupplyChannel(SupplyChannel supplyChannel) {
        return supplyChannelMapper.updateByPrimaryKeySelective(supplyChannel) == 1;
    }

    @Override
    public List<SupplyChannel> getAllSupplyChannel() {
        return supplyChannelMapper.selectByExample(new SupplyChannelExample());
    }
}
